<extend name="Public/base"/>
<block name="body">
<!-- 插件块 -->
<div class="container-span">

<!--商家信息-->
<div class="span4 bgff">
  <div class="columns-mod">
    <div class="hd cf">
      <h5>店铺信息</h5>
    </div>
    <div class="bd ">
      <div class="todolist">
        <ul class="shop-avatar">
          <li class="avatar-box"><a href="{:U('set')}"><img src="{:get_image_thumb(get_cover($data['logo'], 'path'), 84, 86)}" alt=""> <span>编辑logo</span></a></li>
          <li>店铺名称：<i>{:get_short($data['store_name'],20)}</i></li>
          <li>店铺等级：<i>{$data['grade_name']}</i></li>
          <li>管理员：<i>{$data['seller_name']}</i></li>
          <li>上次登录：<i>{:time_format($last_login_time)}</i></li>
          <li>有效期：<i>{:date('Y-m-d',$data['end_time'])}</i></li>
        </ul>
      </div>
    </div>
  </div>
</div>
<!--店铺提醒+订单统计-->
<div class="span4">
  <div class="columns-mod seller-remind bgff">
    <div class="hd cf">
      <h5>店铺提醒</h5>
    </div>
    <div class="bd">
      <dl>
        <dt>店铺\商品提示<br/>
          <span>您需要关注的店铺信息以及待处理事项</span></dt>
          <elt name="stat.item" value="0">
            <dd>商品总数</dd>
          <else />
            <dd class="remind-on"><a href="{:U('Item/index')}">商品总数<i>{$stat['item']}</i></a></dd>
          </elt>
          
          <elt name="stat.sell" value="0">
            <dd>出售中</dd>
          <else />
            <dd class="remind-on"><a href="{:U('Item/index',array('status'=>1))}">出售中<i>{$stat['sell']}</i></a></dd>
          </elt>
          
          <elt name="stat.violation" value="0">
            <dd>违规下架</dd>
          <else />
            <dd class="remind-on"><a href="{:U('Item/index',array('status'=>-2))}">违规下架<i>{$stat['violation']}</i></a></dd>
          </elt>
          
          <elt name="stat.lack" value="0">
            <dd>库存不足</dd>
          <else />
            <dd class="remind-on"><a href="{:U('Item/index',array('store'=>1))}">库存不足<i>{$stat['lack']}</i></a></dd>
          </elt>
          
        <dt>交易提醒<br/>
          <span>您需要立即处理的交易订单</span></dt>
          
          <elt name="stat.order" value="0">
            <dd>交易中</dd>
          <else />
            <dd class="remind-on"><a href="{:U('Order/index',array('o_status'=>-4))}">交易中<i>{$stat['order']}</i></a></dd>
          </elt>
          
          <elt name="stat.unpay" value="0">
            <dd>待付款</dd>
          <else />
            <dd class="remind-on"><a href="{:U('Order/index',array('o_status'=>0))}">待付款<i>{$stat['unpay']}</i></a></dd>
          </elt>
          
          <elt name="stat.unpost" value="0">
            <dd>待发货</dd>
          <else />
            <dd class="remind-on"><a href="{:U('Order/index',array('o_status'=>200))}">待发货<i>{$stat['unpost']}</i></a></dd>
          </elt>
          
          <elt name="stat.unrefund" value="0">
            <dd>待退款</dd>
          <else />
            <dd class="remind-on"><a href="{:U('Order/index',array('o_status'=>300))}">待退款<i>{$stat['unrefund']}</i></a></dd>
          </elt>
          
      </dl>
    </div>
  </div>
  <div class="columns-mod seller-order  bgff">
    <div class="bd" id="chart_box"></div>
  </div>
</div>
<!--消息中心-->
<div class="span4 bgff">
  <div class="columns-mod ">
    <div class="hd cf">
      <h5>消息中心</h5>
        <a href="{:U(message)}" style="float: right; width: auto; margin-right: 15px; height: 49px; line-height: 49px; color: #27ae61" onmouseover="this.style.borderColor='#ffffff';">更多 >> </a>
    </div>
    <div class="seller-news-con">
    <volist name="message" id="vo">
        <dl class="bd seller-news">
            <div class="seller-news-line"></div>
            <dt><i>{:date('m-d',$vo['ctime'])}</i><br/>{:date('Y',$vo['ctime'])}</dt>
            <dd><i></i>
               <i class="z-indx-top"></i>
               <h3 class="J_msg" data-id="{$vo['id']}">
               <eq name="vo.is_read" eq="0">
                   <span></span>
               </eq>
               {$vo['title']}
               </h3>
               <p>{$vo['content']}</p>
            </dd>
         </dl>
     </volist>
    </div>
  </div>
</div>

</block>

<block name="script">
<script language="javascript" type="text/javascript" src="__JS__/echarts/echarts-all.js"></script>
<script type="text/javascript">
  /* 插件块关闭操作 */
  $('.title-opt .wm-slide').each(function(){
    $(this).click(function(){
      $(this).closest('.columns-mod').find('.bd').toggle();
      $(this).find('i').toggleClass('mod-up');
    });
  });
  $(function(){
    //导航高亮
    highlight_subnav("{:U('Store/index')}");
    // 读取系统消息
    $('.J_msg').on('click',function(){
        var msgId = $(this).attr('data-id');
        var _this = $(this);
        $.get("{:U('setMsg')}",{id:msgId},function(data){
            if(data.status){
                _this.find('span').remove();
            }else{
                alert(data.info);
            }
        },'json');
    });
    // 统计图表
    $('#chart_box').css({height:'400px', marginTop:'10px'});
    //$('#search-form').css({marginTop:'400px'});
    var myChart = echarts.init(document.getElementById('chart_box'));
      option = {
        title : {
          text : '订单趋势图'
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          data: {$stat.chartData.legend}
        },
        toolbox: {
          show: true,
          feature: {
            dataView: {show: false, readOnly: false},
            type : ['tiled'],
          },
          x : '130',
        },
        calculable: true,
        xAxis: [
          {
            type: 'category',
            boundaryGap: false,
            data: {$stat.chartData.xAxis}
          }
        ],
        yAxis: [
          {
            type: 'value'
          }
        ],
        series: {$stat.chartData.data}
      };
      myChart.setOption(option);
  });
  </script>
</block>